
from datetime import datetime


def parse_ascII_to_command(ascII_str: str) -> bytearray:

    '''ascII字符串转成命令
    >>> parse_ascII_to_command("313630313030303030303031")
    >>> bytearray(b'160100000001')
    '''
    command = bytearray()

    for i in range(0, len(ascII_str), 2):
        hex_val = chr(int(ascII_str[i:i+2], 16))
        command.append(ord(hex_val))

    return command

def parse_strtime_to_timestamp(strtime = '2024-01-22T14:25:09.271000Z'):



    timestamp = datetime.strptime(strtime, '%Y-%m-%dT%H:%M:%S.%fZ').timestamp() * 1000
    print(int(timestamp))

    return timestamp

if __name__ == "__main__":

    parse_strtime_to_timestamp()